package com.kotodama.infrastructure.config;

import jakarta.validation.Validation;
import jakarta.validation.Validator;
import jakarta.validation.ValidatorFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Bean Validation配置类
 * 替换Drools规则引擎配置
 */
@Configuration
public class ValidationConfig {

    /**
     * 配置Validator Bean
     * 用于Bean Validation验证
     */
    @Bean
    public Validator validator() {
        ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
        return factory.getValidator();
    }
}